#ifndef FILTERWIDGET_H
#define FILTERWIDGET_H

#include <QSignalMapper>
#include <QComboBox>
#include <QLabel>
#include <QLineEdit>
#include <QStringList>
#include <QObject>
#include "../json/json.h"
#include "constantvalues.h"
#include "ui_filterwidget.h"
#include <QObject>
#include <QRegExp>

using namespace Json;

class FilterWidget : public QWidget, public Ui::FilterWidget
{
	Q_OBJECT

	public:
		FilterWidget(QWidget *parent=0);
		void init(Value filterValue);
		Value getFilter();

	private:
		Value filter;
		QSignalMapper *signalMapper;
	
		int nextHeight;
		ConstantValues *constantValues;
		void addField(QString value,QString pathValue,QString mappingID);
		void addEnum(QString value,QString pathValue,QString mappingID);
		void formSync();
		int findPath(QString path);
		void cleanPathChildren(QString path);
		QString getEnumEditValue(QString filterPath);
		QString getFieldEditValue(QString filterPath,int nr);
		void addEnumMatchToFilter(QString filterPath);
	private slots:
		void generateForm();
		void processClick(const QString &mappingID);
		
		
};

#endif
